package com.neusoft.elmboot.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 平台收益记录实体类
 */
@Data
@NoArgsConstructor
@TableName(value = "platform_revenue")
public class PlatformRevenue implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 收益记录ID
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 关联订单ID
     */
    private Integer orderId;

    /**
     * 商家ID
     */
    private String businessId;

    /**
     * 用户ID
     */
    private String userId;

    /**
     * 订单金额
     */
    private BigDecimal orderAmount;

    /**
     * 平台手续费
     */
    private BigDecimal platformFee;

    /**
     * 商家实际收到金额
     */
    private BigDecimal businessReceived;

    /**
     * 关联交易ID
     */
    private String transactionId;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    public PlatformRevenue(Integer orderId, String businessId, String userId, 
                          BigDecimal orderAmount, BigDecimal platformFee, 
                          BigDecimal businessReceived, String transactionId) {
        this.orderId = orderId;
        this.businessId = businessId;
        this.userId = userId;
        this.orderAmount = orderAmount;
        this.platformFee = platformFee;
        this.businessReceived = businessReceived;
        this.transactionId = transactionId;
        this.createTime = LocalDateTime.now();
    }
}
